/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     struct ListNode *next;
 * };
 */
typedef struct ListNode ListNode;
bool isPalindrome(struct ListNode* head)
{
    if (head == NULL)
        return NULL;
    int arr[200000];
    int cal = 0;
    ListNode* pcur = head;
    while (pcur)
    {
        arr[cal++] = pcur->val;
        pcur = pcur->next;
    }
    for (int i = 0; i < cal / 2; i++)
    {
        if (arr[i] != arr[cal - 1 - i])
            return false;
    }
    return true;
}